package test.enba.web.controller;

import com.alibaba.fastjson.JSON;
import com.enba.boot.core.context.SecurityContextHolder;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class WebController {

  /**
   * 演示：获取上下文信息
   *
   * @return
   */
  @GetMapping("/hello")
  public String print() {
    Map<String, Object> localMap = SecurityContextHolder.getLocalMap();

    System.out.println(localMap);
    return JSON.toJSONString(localMap);
  }
}
